import { http } from "@/utils/http";
export function getCategoryPageList(data: Partial<ShopCategoryPageRequest & PageRequest>) {
  return http.post<MResponse<PageVo<Array<ShopCategoryVo>>>>("/product/category/getCategoryPageList", { data });
}

export function addCategory(data: ShopCategoryAddRequest) {
  return http.post<MResponse>("/product/category/addCategory", { data });
}

export function updateCategory(data: ShopCategoryUpdateRequest) {
  return http.post<MResponse>("/product/category/updateCategory", { data });
}

export function delCategory(data: ShopCategoryDelRequest) {
  return http.post<MResponse>("/product/category/delCategory", { data });
}

export function getCategorySelect(parentId: any) {
  return http.post<MResponse<Array<SelectVo>>>("/product/category/getCategorySelect", { data: { parentId } });
}

export function getCategoryTree() {
  return http.post<MResponse<Array<SelectTreeVo>>>("/product/category/getCategoryTree");
}
